import {ADD_TODO, DEL_TODO, CLEAR_COMPLETED_TODO, CHANGE_TODO, TOGGLE_TODO, TOGGLE_ALL} from '../action-types';

export const addTodo = text => {
    return {type: ADD_TODO, text}
};

export const delTodo = id => {
    return {type: DEL_TODO, id}
};

export const changeTodo = (id, text) => {
    return {type: CHANGE_TODO, id, text}
};

export const clearCompletedTodo = () => {
    return {type: CLEAR_COMPLETED_TODO}
};

export const toggleTodo = id => {
    return {type: TOGGLE_TODO, id}
};

export const toggleAll = (toggle) => {
    return {type: TOGGLE_ALL, toggle}
};
